<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SEND_ORDER command Example :: Master-Unlock API</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" />
</head>

<body>
<h1>SEND_ORDER</h1>
<?php
	/* Include the library */
	require ('../library/api.php');
	
	/* Call the API */
	$xml = MasterUnlock::CallAPI('SEND_ORDER', array('SERVICE_ID' => 150, 'IMEI' => '123454321234567', 
		'COUNTRY_ID' => '69', 'MOBILE_ID' => 8292, 'NETWORK_ID' => 1005, 'MEP' => 'MEP-56545-122',
		'PROVIDER_ID' => '123As-1Q2w3Qe', 'USER' => 'Superman', 'SERIE' => '1q2w3e4r4t', 'ID_BOX' => '456r5r6',
		'NICK' => 'Nickolas', 'PASSWORD' => '123pass', 'RM' => 'test'));
	die(htmlentities($xml));
	if (is_string ($xml)){
		/* Parse the XML stream */
		$data = MasterUnlock::ParseXML($xml);
		
		if (is_array ($data)){
			if (isset ($data['ERROR_MESSAGE'])) {
				/* The API has returned an error */
				print ('API error : ' . htmlspecialchars ($data['ERROR_MESSAGE']));
			} else {
				/* Everything works fine */
				print ('<b>' . htmlspecialchars ($data['SUCCESS']) . '</b>');
			}
		} else {
			/* Parsing error */
			print ('Could not parse the XML stream');
		}
	} else {
		/* Communication error */
		print ('Could not communicate with the api');
	}
?>
<p><a href="./">Go back</a></p>
</body>
</html>